<div class="groups index">
<h2><?php __('Groups');?></h2>
<!-- Left Fat Section -->
<div class="widfats">
    <!-- Table Navigation -->
    <div class="tablenav">
        <div class="batchactions"></div>
        <?php echo $this->element('pager'); ?>
    </div>
    <!-- Table Content Area -->
    <table id="table_groups" class="table fixed">
        <thead title="<?php __('Click a column to sort data table'); ?>">
            <tr>
                <th width="5%" class="checkbox" title="<?php __('Click to select/deselect all records'); ?>"><input type="checkbox" class="checkbox"/></th>
                <th width="12%"><?php echo $paginator->sort('id');?></th>
                <th width="24%"><?php echo $paginator->sort('name');?></th>
                <th width="24%"><?php echo $paginator->sort('user_count');?></th>
                <th width="35%" class="actions"><?php __('Actions');?></th>
            </tr>
        </thead>
        <tfoot title="<?php __('Click a column to sort data table'); ?>">
            <tr>
                <th class="checkbox" title="<?php __('Click to select/deselect all records'); ?>"><input type="checkbox" class="checkbox"/></th>
                <th><?php echo $paginator->sort('id');?></th>
                <th><?php echo $paginator->sort('name');?></th>
                <th><?php echo $paginator->sort('user_count');?></th>
                <th class="actions"><?php __('Actions');?></th>
            </tr>
        </tfoot>
        <tbody>
            <?php foreach ($groups as $i=>$group):
                $class = $i % 2 == 0 ? ' class="altrow"' : ''; ?>
            <tr<?php echo $class;?>>
                <td class="checkbox"><input type="checkbox" class="checkbox"/></td>
                <td><?php echo $group['Group']['id']; ?></td>
                <td><?php echo $group['Group']['name']; ?></td>
                <td><?php echo $group['Group']['user_count']; ?></td>
                <td class="actions">
                    <?php echo $html->link(__('View', true), array('action'=>'view', $group['Group']['id'])); ?>
                    <?php echo $html->link(__('Edit', true), array('action'=>'edit', $group['Group']['id'])); ?>
                    <?php echo $html->link(__('Delete', true), array('action'=>'delete', $group['Group']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $group['Group']['id'])); ?>
                    <?php echo $html->link(__('Security', true), array('action'=>'security', $group['Group']['id'])); ?>
                </td>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
</div>
<!-- Right sidebar section -->
<div class="sidebar">
    <!-- User Add Form -->
    <div id="widget_add_group" class="widget">
        <div class="toggle">&nbsp;</div>
        <h3 class="handle"><span><?php __('Add Group');?></span></h3>
        <div class="content">
            <div class="groups form">
                <?php echo $form->create('Group');?>
                    <fieldset>
                        <?php echo $form->input('name', array('class'=>'input text', 'label'=>__('Group Name', true))); ?>
                        <?php echo $form->input('parent_id', array('class'=>'select', 'label'=>__('Parent Group', true), 'empty' => __('-Parent Group-', true))); ?>
                        <br class="clear"/>
                        <?php e($form->submit(__('Add Group', true), array('class'=>'submit'))); ?>
                    </fieldset>
                <?php echo $form->end();?>
            </div>
        </div>
    </div>
    <!-- User Edit Form -->
    <div id="widget_edit_group" class="widget">
        <div class="toggle">&nbsp;</div>
        <h3 class="handle"><span><?php __('Edit Group');?></span></h3>
        <div class="content">
            <p class="faq"><?php __('There is no group to edit now'); ?></p>
        </div>
    </div>
    <!-- Quick Actions -->
    <div id="widget_quick_actions" class="widget">
        <div class="toggle">&nbsp;</div>
        <h3 class="handle"><?php __('Quick Actions');?></h3>
        <div class="content">
            <div class="actions">
                <ul>
                    <li><?php echo $html->link(__('New Group', true), array('action'=>'add')); ?></li>
                    <br class="clear"/>
                </ul>
            </div>
        </div>
    </div>
</div>
</div>